﻿using Nemerle.Collections;
using Nemerle.Text;
using Nemerle.Utility;

using System;
using System.Collections.Generic;
using System.Linq;

namespace Nemerle2.Compiler
{
  /// <summary>
  /// Syntax macro rule.
  /// </summary>
  [Record]
  public variant PRule : PAst
  {
    | Named       { Name : PId; Rule : PRule; }
    | Ref         { Name : PId; }
    | Sequence    { Rules : LocatedList[PRule]; }
    | Choice      { Rules : LocatedList[PRule]; }
    | Predicate   { Value : PRulePredicate;     Rule : PRule; }
    | Cardinality { Value : PRuleCardinality;   Rule : PRule; }
    | Error       { Msg : Msg; }
  }
}
